#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include <string>
using namespace std;

class A {
public:
	A()
	{
		cout << "A()" << endl;
	}
	~A()
	{
		cout << "~A()" << endl;
	}
private:
	int a;
};


int main() {
	string s;
	while (getline(cin,s)) {
		int head = s.rfind(" ")+1;
		int tail = s.size();
		cout << tail - head << endl;
	}
}